feat: auto-discover target-keyed agent-context sidecars - #540
Conversation
|
PR author is not in the allowed authors list. |
|
I think this is a good idea, but I'd want it to somehow match the changeset/rev range somehow. e.g. the next time you run So I think we'd want some kind of id in the sidecar json filename. |
Auto-load `.hunk/agent-context.<targetId>.json` for the current review target so notes for one range or show do not attach on another. Bare `agent-context.json` is never auto-discovered; explicit and config paths stay strict. Implements maintainer feedback on modem-dev#540: discovery is scoped by review-target identity in the filename, not a single repo-wide bare path.
3d4413d to
fbee662
Compare
|
@alleneubank is attempting to deploy a commit to the Modem Team on Vercel. A member of the Team first needs to authorize it. |
|
@benvinegar — thank you for the review on the earlier auto-discovery shape. We took your suggestion: discovery is now target-scoped via the filename, not a single bare Convention: Guarantees:
We deliberately did not put a full patch content hash in the filename (working-tree thrash / agents rewriting the name every edit). Content drift still soft-fails via existing range matching. Happy to adjust further if you want a different canonical payload or id length. |
Auto-load `.hunk/agent-context.<targetId>.json` for the current review target so notes for one range or show do not attach on another. Bare `agent-context.json` is never auto-discovered; explicit and config paths stay strict. Export reports `agentContextPath` for agents (modem-dev#540).
Pure viewport-scroll interaction fixtures set initialCursorLine off so arrows call scrollDiff instead of moveLineCursor. Align bootstrap-prefs note order with note-after-annotated-line layout. LOOP.md marks campaign interior-green with floor citations and human handoff for modem-dev#540.
Integrate the VS Code extension, headless review, viewed state, and standing SPEC/BRIEF with the clean modem-dev#540 agent-context commit on current upstream/main.
Summary
.hunk/agent-context.<targetId>.jsonfor the current review target (working tree, staged, range, show, stash-show + sorted pathspecs).hunk/agent-context.json(that was the confusing partial-attach case). Explicit--agent-context/ configagent_contextstill load any path, including a legacy bare name--no-agent-contextopt-out; exclude.hunk/metadata from untracked review noiseWhy (response to review)
@benvinegar called out that unscoped auto-discovery of a fixed bare sidecar can load notes against a different review and partially apply them. This revision keys discovery on review target identity in the filename (not patch content hash, which would thrash on every working-tree edit). Same pure function for discovery, watch, and agent skill guidance.
targetId= first 12 hex of SHA-256 over a canonical target string. Users never type it; agents write the conventional path for the same CLI args they open the review with.User impact
.hunk/agent-context.jsonauto-loaded on everyhunk diff/ show / range.hunk/agent-context.<id>.jsonfor this target auto-loadsVerification
bun run typecheckbun test src/core/agentContextPath.test.ts src/core/config.test.ts src/core/agent.test.ts(78 pass)bun run typecheckon this branch tipNotes for cherry-pick
Single feat commit on current
main. No SPEC/BRIEF/LOOP campaign docs on this PR.